const net = require('node:net')
const HOST = '127.0.0.1'
const PORT = 6969

const client = new net.Socket()

client.connect(PORT, HOST, () => {
	console.log(`connected to： ${HOST}:${PORT}`)
	client.write('I am chunk Norris!')
})

client.on('data', (buf) => {
	console.log(`data: ${buf}`)
	client.destroy()
})

client.on('close', () => {
	console.log('Connection closed')
})